<!--  -->
<template>
  <div>
  子组件{{ props.msg }}

  {{ props.user.name }}

  {{ props.arr }}
  </div>
</template>

<script lang='ts' setup>
import { reactive,toRefs,ref,defineProps,withDefaults} from 'vue'
// const props= defineProps(['msg'])
// const props= defineProps({
//     msg:{
//         type:String,
//         default:"",
//         required: true,
//     }
// })

interface User{
    name:string,
    mobile:string
}

 interface DataType{
    msg:string,
    user:User,
    arr:string[]
 }
 const props=  withDefaults(defineProps<DataType>(),{
    msg:"您好",
    user:()=>({name:"张三",mobile:"135"}),
    arr:()=>["a","b"]
 })

</script>
<style scoped>
</style>